package com.lm.activiti.boot.arith;

import org.junit.Test;

/**
 * @author lm_jcf
 * @date 2022/6/20 11:32
 */
public class FibonacciTest {

    @Test
    public void test(){
        for (int i = 0; i < 10; i++) {
            System.out.println(fibonacci(i));
        }
    }

    public int fibonacci(int i){
        if (i == 0 || i == 1) {
            return i;
        }

        return fibonacci(i - 1) + fibonacci(i - 2);
    }

}
